/**
 * 
 */
package app.xml.model;

import java.util.Date;
import java.util.List;

/**
 * Represents a row in the notes area table.  
 */
public class UserNote {
	static final String DEFAULT_STRING_VALUE = "";
	static final Date DEFAULT_DATE = new Date(0); // the "epoch", aka 1970
	
	// Set to default values. 
	Date timeStamp = DEFAULT_DATE;
	String fileName = DEFAULT_STRING_VALUE;
	String filePath = DEFAULT_STRING_VALUE;
	String note = DEFAULT_STRING_VALUE;
	String annotation = DEFAULT_STRING_VALUE;
	Integer annotationIndex = 0;
	
	/**
	 * Initializes fields to default values. 
	 * Strings are initialized to the empty string. 
	 * Use this constructor to create the blank row for the end of the table. 
	 */
	public UserNote (){
	}

	public Date getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(Date timeStamp) {
		this.timeStamp = timeStamp;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFilePath() {
		return filePath;
	}

	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getAnnotation() {
		return annotation;
	}

	public void setAnnotation(String annotation) {
		this.annotation = annotation;
	}
	
	public int getAnnotationIndex() {
		return annotationIndex.intValue();
	}

	public void setAnnotationIndex(Integer annotationIndex) {
		this.annotationIndex = annotationIndex;
	}

	public boolean isBlankRow(){
		// This field is never blank once we 
		// have edited the row, so we can use 
		// it as an indicator of whether this
		// is the blank row appended to the 
		// end of the table. 
		return fileName.equals(DEFAULT_STRING_VALUE);
	}
}